package gridy.node;

import org.apache.tuscany.sca.node.launcher.NodeLauncher;

public class LaunchGeneticAlgorithm {
    
    public static void main(String[] args) throws Exception {
        
        if (args.length != 2 && args.length != 1) {
            System.err.println("Argumenty: [nazwa_hosta_domain_managera] ([port_domain_managera])");
            System.exit(1);
        }        
        String hostname = args[0];
        int port = 9990;
        if (args.length == 2) {
            port = Integer.parseInt(args[1]);
        }
        
        String domainManagerLocation = String.format("http://%s:%d/node-config/NodeGeneticAlgorithm",hostname,port);
        NodeLauncher.main(new String[] {domainManagerLocation});
    }
}
